package com.tisson;

import java.util.Iterator;
import java.util.List;

import com.tisson.dao.AdminDAO;
import com.tisson.pojo.Admin;
//modify by jim
public class CheckService {
	private AdminDAO dao = new AdminDAO();

	public boolean isExist(String username, String password) {
		List list = dao.findAll();
		for (Iterator iterator = (Iterator) list.iterator(); iterator.hasNext();) {
			Admin admin = (Admin) iterator.next();
			if (username.equals(admin.getUsername())) {
				return password.equals(admin.getPassword());
			}
		}
		return false;
	}

}
